package main

import (
	"github.com/julienschmidt/httprouter"
	"net/http"
	"video/scheduler/dbops"
)

func vidDelRecHandler(w http.ResponseWriter, r *http.Request, p httprouter.Params) {
	videoName := p.ByName("video-name")
	if len(videoName) == 0 {
		sendResponse(w, 400, "video name should not be empty")
		return
	}
	err := dbops.AddVideoDeletionRecord(videoName)
	if err != nil {
		sendResponse(w, 500, "Internal server error")
		return
	}
	sendResponse(w, 200, "")
	return
}
